<template>
  <div>child</div>
  <h2>age:{{age}}</h2>
  <h3>length:{{length}}</h3>
</template>

<script>
import {computed, defineComponent, toRef} from 'vue'
function useGetLength(age) {
    return computed(()=>{
        return age.value.toString().length
    })
}
export default defineComponent({
  name: 'App',
  props:['age'],
  setup(props) {
      const length = useGetLength(toRef(props,'age'))
      return {
          length
      }
  }
})
</script>

<style lang="less" scoped>

</style>
